//
//  numberOneViewController.m
//  AllLessons
//
//  Created by QY on 15/8/20.
//  Copyright (c) 2015年 mohekeji. All rights reserved.
//

#import "numberOneViewController.h"
#import "numberTwoViewController.h"

@interface numberOneViewController ()

@end

@implementation numberOneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor redColor];
//    lab= [[UILabel alloc] init];
//    lab.frame=CGRectMake(100, 200, 200, 20);
//    lab.backgroundColor=[UIColor blueColor];
//    lab.text=@"出来吧";
//    [self.view addSubview:lab];
//    UIButton*but=[[UIButton alloc]initWithFrame:CGRectMake(100, 400, 100, 50)];
//    but.backgroundColor=[UIColor brownColor];
//    [but setTitle:@"debug" forState:UIControlStateNormal];
//    [but addTarget:self action:@selector(doit) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:but];

    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)doit
{
    numberTwoViewController*www=[[numberTwoViewController alloc]init];
    [self.navigationController pushViewController:www animated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
-(void)viewWillAppear:(BOOL)animated
{
    self.view.backgroundColor=[UIColor blueColor];
   
}
-(void)viewDidAppear:(BOOL)animated
{
    self.view.backgroundColor=[UIColor redColor];
    lab= [[UILabel alloc] init];
    lab.frame=CGRectMake(100, 200, 200, 20);
    lab.backgroundColor=[UIColor blueColor];
    lab.text=@"出来吧";
    [self.view addSubview:lab];
    
    UIButton*but=[[UIButton alloc]initWithFrame:CGRectMake(100, 400, 100, 50)];
    but.backgroundColor=[UIColor brownColor];
    [but setTitle:@"debug" forState:UIControlStateNormal];
    [but addTarget:self action:@selector(doit) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:but];
}
-(void)viewWillDisappear:(BOOL)animated
{
    self.view.backgroundColor=[UIColor greenColor];
    lab= [[UILabel alloc] init];
    lab.frame=CGRectMake(100, 200, 200, 20);
    lab.backgroundColor=[UIColor blueColor];
    lab.text=@"我要消失了";
    [self.view addSubview:lab];

}
-(void)viewDidDisappear:(BOOL)animated
{
    self.view.backgroundColor=[UIColor greenColor];
    lab= [[UILabel alloc] init];
    lab.frame=CGRectMake(100, 200, 200, 20);
    lab.backgroundColor=[UIColor blueColor];
    lab.text=@"我会回来的";
    [self.view addSubview:lab];
    
}

@end
